Block Arena Client Commands


One can toggle the console by pressing the '~' key.

Commands can be entered while in the console. For example, entering the command "move forward start" will cause the player to start moving forward.

All commands return a value. One can input complex commands using S-expressions. For example, "echo (vec 1.0 2.0 3.0)" will print "1 2 3" to the console. The outermost S-expression should not have parentheses around it. For another example, "echo (if (== (+ 2 3) 5) 1 0)" will print "1" to the console.

The dollar sign '$' followed by a string literal is syntactic sugar for the "get" command.

One can list all the commands from the console using the help command. This can also be used to print information about individual commands. All that help information is included in this html document. In fact, this document was generated using the "gendoc" command.

There are actually two consoles: one for the client, and one for the server. One can go between the two by typing either "client" or "server". Both the client and server have their own set of commands.



*
Usage: * X Y

Returns X multiplied by Y. If X and Y are both
ints, then an int will be returned. If one of X
or Y is a float, then a float will be returned.


*=
Usage: *= VAR F

Multiplies the environment variable VAR by the
float F.


+
Usage: + X Y

Returns X plus by Y. If X and Y are both ints,
then an int will be returned. If one of X or Y
is a float, then a float will be returned.


++
Usage: ++ STR1 STR2

Returns the string STR1 concatenated with the
string STR2.


+=
Usage: += VAR X

Multiplies the environment variable VAR by X.
Note: The types of $VAR and X must agree.


+attack1
This is an alias for the command
"shoot primary start".


+attack2
This is an alias for the command
"shoot secondary start".


+back
This is an alias for the command
"move back start".


+clip
This is an alias for the command
"move clipping on".


+fly
This is an alias for the command
"move flymode on".


+forward
This is an alias for the command
"move forward start".


+moveleft
This is an alias for the command
"move left start".


+moveright
This is an alias for the command
"move right start".


-attack1
This is an alias for the command
"shoot primary stop".


-attack2
This is an alias for the command
"shoot secondary stop".


-back
This is an alias for the command
"move back stop".


-clip
This is an alias for the command
"move clipping off".


-fly
This is an alias for the command
"move flymode off".


-forward
This is an alias for the command
"move forward stop".


-moveleft
This is an alias for the command
"move left stop".


-moveright
This is an alias for the command
"move right stop".


==
Usage: == EXP1 EXP2

Returns true if the expressions EXP1 and EXP2 are
equal, otherwise returns false.


alias
Usage: alias ALIAS_NAME CMD_STRING

Adds a new alias called ALIAS_NAME which
evaluates to the command CMD_STRING. Although an
existing alias can be replaced by a new alias, a
command cannot be replaced.


bind
Usage: bind INPUT STR
bind defaults

The command "bind INPUT STR" binds the command
STR to the input INPUT. For example: bind
KEY_W.down "move start forward" causes the player
to start moving forward when the key W is pressed
down. The command "bind defaults" resets the
bindings to their defaults.


cd
Usage: cd VAR_PATH

Sets the environment variable console.cwd to
VAR_PATH. This variable is used by the ls
command. See also: ls, pwd.


chat
Usage: chat begin
chat end
chat all MSG

The command "chat begin" opens the chat window,
and "chat end" closes it. The command "chat all
MSG" sends the chat message MSG to all players.


clear
Usage: clear

Clears the console screen.


console
Usage: console begin
console end

Opens / closes the console window.


curwep
Usage: curwep

Returns the current selected weapon number.


ddump
Usage: ddump

Dumps the current debug stack to standard output.


delete
Usage: delete VAR_NAME

Deletes the environment variable. Note: VAR_NAME
must start with "home.".


detonate
This is an alias for the command
"shoot detonate".


download
Usage: download HASHCODE

Downloads file with the given CRC32 hashcode (in
hex). For example: "download 66a94fa2".


dumpenv
Usage dumpenv

Prints all of the environment variables to
standard output.


echo
Usage: echo STRING

Prints the string STRING to the console.


exec
Usage: exec COMMAND_STR

Executes the command stored by COMMAND_STR. For
example, "exec $foo" will execute the command
string stored in the environment variable foo.


execf
Usage: execf FILENAME

Executes all the commands in the file FILENAME.
Every line of the file should be either a valid
S-expression or a comment line (all whitespace or
starting with the character '#'). FILENAME
should be a path relative to the directory
GameParams/Scripts/.


exit
Usage: exit

Exits the program.


gencloud
Usage: gencloud N screen

Creates a file with point cloud information
generated by shooting N rays into the world from
the camera position. Note: the theta and phi
spherical coordinates of each ray are chosen
randomly within intervals. This is done on
purpose.


gendoc
Usage: gendoc

Generates an html file with documentation about
all commands.


get
Usage: get VAR

Returns the value stored by the environment
variable VAR. Note that the dollar sign followed
by a string literal is syntactic sugar for the
get command. That is, "$VAR" is equivalent to
"(get VAR)".


help
Usage: help
help NAME

The command "help" lists all commands in white
and aliases in pink. The command "help NAME"
prints help information about the command or
alias NAME.


jump
This is an alias for the command
"move jump".


lastwep
Usage: lastwep

Returns the number of the weapon that was last
selected.


let
Usage: let VAR_NAME VALUE

Creates/sets the environment variable VAR_NAME to
VALUE. Note: VAR_NAME must start with "home.".


ls
Usage: ls
ls PATH
ls PATH v

The command "ls" lists all variables in the
"current working directory" (See also: cd, pwd).
The command "ls PATH" lists all variables in the
name directory PATH. The command "ls PATH v"
lists the name and values of all variables in the
name directory PATH.


move
Usage: move forward (start | stop)
move backward (start | stop)
move left (start | stop)
move right (start | stop)
move flyup (start | stop)
move flydown (start | stop)
move jump
move turn dx dy
move flymode (on | off)
move clipping (on | off)

Controls the movement of the player.


nextwep
Usage nextwep BOOL

Switches to the next weapon with ammo. If BOOL
== true, switches to a higher weapon number.
Otherwise, switches to a lower one.


not
Usage: not BOOL

Returns the negation of the bool BOOL.


print
Usage: print STR

Prints the string STR to standard output.


pwd
Usage: pwd

Prints the current working "directory". See
also: cd, ls.


quit
This is an alias for the command
"exit".


refresh
Usage: refresh

Requests a state refresh from the server.


render
Usage: render only_world (enable | disable | toggle)

Controling whether only the world should be
rendered.


respawn
Usage: respawn passive
respawn force

Sends a respawn request to the server. If
forcibly respawning, then will attempt to respawn
even if the player is still alive. Otherwise,
will only respawn if the player is dead.


seq
Usage: seq EXP_1 EXP_2 ... EXP_N

Evaluates the expressions EXP_1 through EXP_N
from left to right, returning the value that
EXP_N evaluates to. That is, this command can be
used to execute a sequence of commands. For
example, "seq (echo hello) (echo there)" will
print "hello" and then "there" to the console,
and void will be returned (because "(echo there)"
evaluates to void).


set
Usage: set VAR_NAME VALUE

Sets the environment variable VAR_NAME to VALUE.


shoot
Usage: shoot primary (start | stop)
shoot secondary (start | stop)
detonate

For shooting the current weapon or for sending a
"detonate" request.


sound
Usage: sound hello_world
sound play SOUND_NAME
sound play3d SOUND_NAME pos_vector

Plays a sound.


switchwep
Usage: switchwep NUM

Switches the current weapon to number NUM.


toggle
Usage: toggle VAR_NAME

Equivalent to "set VAR_NAME (not (get
VAR_NAME))".


tostring
Usage: tostring EXP

Returns the expression EXP converted to a string.


type
Usage: type EXP

Returns the type of the expression EXP. For
example, "echo (type (vec 1.0 2.0 3.0))" will
print "vector" to the console.


unalias
Usage: unalias name ALIAS_NAME
unalias all

The command "unalias name ALIAS_NAME" removes the
alias ALIAS_NAME The command "unalias all"
removes all aliases.


unbind
Usage: unbind INPUT

Unbinds the input event INPUT.


vec
Usage: vec X Y Z

Returns the vector whose components are the
floats X,Y,Z.